﻿using Engine.Sgml.Configuration;
using Engine.Sgml.Matching;
using Engine.Dtd.Schema;

namespace Engine.Sgml.Validation.Rules {
    internal class TableRule : DefaultRule {
        public TableRule(SName name, ValidatorBehavior settings)
            : base(name, settings) {
            }

        public override bool CanClose(SElement element, SElement endElement) {
            if (ElementMatcher.Match(element, endElement))
                return true;
            if (endElement.ElementType == DElementType.Block && element.Parent != null && ElementMatcher.Match(element.Parent, endElement))
                return true;
            else
                return false;
            }
        }
    }
